//index.js
import api from '../../tool/requestModel.js'
Page({
	data: {
		boxList: [],
		answerList: {},
		userName: '',
		isShow:false,
		imgurl:'',
        product_id: '',
	},
	onLoad: function(option) {
        
        this.setData({
            product_id: option.id
        })
		api.answer({
			product_id: option.id,
			scoer: option.scoer,
            user_id:tt.getStorageSync("userId")
		}).then(res => {
			this.setData({
				answerList: res.data,
				isShow:true,
				imgurl:res.data.answer_img
			})
		}) 
		this.setData({
			userName: tt.getStorageSync('userName')
		})
	},
    scrollTo:function(){
        tt.pageScrollTo({
            scrollTop: tt.getSystemInfoSync().windowHeight,
            duration: 300
        })
    },
    zaici:function(){
        tt.reLaunch({
		    url: '../../pages/ljcs/ljcs?id=' + this.data.product_id,
	    })
    }
})
